<template>
  <div class="img-list">
    <ul>
      <li v-for="(pic, index) in imgList" :key="index">
        <img v-lazy="pic.url" alt="" />
        <div class="title">{{ pic.title }}</div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    imgList: {
      type: Array,
      default: () => {
        return []
      },
    },
  },
}
</script>

<style lang="less" scoped>
.img-list {
  overflow: auto;
  li {
    background-color: #fff;
    float: left;
    width: 260px;
    margin-left: 20px;
    margin-bottom: 20px;
    border-radius: @u-border-radius;
    overflow: hidden;
    transition: all 0.3s ease;
    .title {
      line-height: 40px;
      padding-left: 10px;
    }
    &:nth-child(5n + 1) {
      margin-left: 0px;
    }
    &:hover {
      opacity: 0.9;
      transform: scale(0.98);
      background-color: #ffe300;
    }
  }
  img {
    width: 100%;
    height: 195px;
    display: block;
  }
}
</style>
